import { http,domain } from "@/utils/http";

export type Result = {
    code: number;
    msg: string;
    data: any;
}


export const addObj = (data?: object) => {
  return http.request<Result>("post", domain+"/$TABLENAME$/add", { data });
};


export const deleteObj = (params?: object) => {
    return http.request<Result>("get", domain+"/$TABLENAME$/delete", { params });
}

export const updateObj = (data?: object) => {
    return http.request<Result>("post", domain+"/$TABLENAME$/update", { data });
}


export const listObjs = (params?: object) => {
  return http.request<Result>("get", domain+"/$TABLENAME$/list", { params });
};
export const getObj = (params?: object) => {  
    return http.request<Result>("get", domain+"/$TABLENAME$/get", { params });
}